package android.team.app.ui.missatoll;

import android.os.Bundle;
import android.team.app.R;
import android.team.app.ui.BaseActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.Spinner;

public class PersonalInfomationActivity extends BaseActivity{
	
	private Spinner spState, spGender;
	private EditText edFirstName, edLastName, edMiddleInital, edCity, edZipcode, edAdress, edEmail, edPhone1, edPhone2, edPhone3, edPhone4;
	
	private CheckBox cbCheckMail;
	private ImageButton imgBtNext;
	
	private String gender, state;
	private boolean ischeckMail = false;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.personals_infomation_activity);
		
		loadUI();
		
		titleHeader.setText(getString(R.string.personal_infomation));
		
		loadSpecialUI();
	}
	
	@Override
	protected void setTitleHeader(String title) {
		// TODO Auto-generated method stub
		super.setTitleHeader(title);
		
		
	}
	
	private void loadSpecialUI(){
		spGender = (Spinner)findViewById(R.id.spinnerGender);
		spGender.setAdapter(new ArrayAdapter<String>(
				baseActivity, 
				android.R.layout.simple_spinner_item, 
				getResources().getStringArray(R.array.title)));//phuong thuc 4
		
		spGender.setOnItemSelectedListener(new OnItemSelectedListener() {

			@Override
			public void onItemSelected(AdapterView<?> parent, View view,
					int pos, long id) {
				// TODO Auto-generated method stub
				gender = parent.getItemAtPosition(pos).toString();
			}

			@Override
			public void onNothingSelected(AdapterView<?> arg0) {
				// TODO Auto-generated method stub
				gender = "Mr";
			}
		});
		
		
		
		spState = (Spinner)findViewById(R.id.spinnerState);
		spState.setAdapter(new ArrayAdapter<String>(
				baseActivity, 
				android.R.layout.simple_spinner_item, 
				getResources().getStringArray(R.array.states)));
		
		edFirstName = (EditText)findViewById(R.id.editFirstName);
		edLastName = (EditText)findViewById(R.id.editLastName);
		edMiddleInital = (EditText)findViewById(R.id.editMiddleName);
		edAdress = (EditText)findViewById(R.id.editAddress);
		edCity = (EditText)findViewById(R.id.editCity);
		edZipcode = (EditText)findViewById(R.id.editZipCode);
		edEmail = (EditText)findViewById(R.id.editEmail);
		
		edPhone1 = (EditText)findViewById(R.id.editPhone1);
		edPhone2 = (EditText)findViewById(R.id.editPhone2);
		edPhone3 = (EditText)findViewById(R.id.editPhone3);
		edPhone4 = (EditText)findViewById(R.id.editPhone4);
		
		cbCheckMail = (CheckBox)findViewById(R.id.chkEmailCopy);
		imgBtNext = (ImageButton)findViewById(R.id.btnNext);
		
	}
}
